package nowcoderLinkList;

import java.util.List;

public class Text {
    public static void createCycle(MySingleList.ListNode head) {

    }

    public static void main(String[] args) {
        System.out.println("======测试删除倒数第k个节点=======");
        MySingleList mySingleList = new MySingleList();
        mySingleList.createLink();
        mySingleList.removeNthFromEnd(mySingleList.head, 2);
        mySingleList.display4(mySingleList.head);
    }
    public static void main1(String[] args) {
        System.out.println("=====测试打印=====");
        MySingleList mySingleList = new MySingleList();
        mySingleList.createLink();
        mySingleList.display4(mySingleList.head);
        /*mySingleList.display4(mySingleList.head);
        System.out.println();
        System.out.println("=====测试查找=====");
        Boolean ret = mySingleList.contains(7);
        System.out.println(ret);
        System.out.println("=====测试长度=====");
        int size = mySingleList.size();
        System.out.println(size);
        System.out.println("=====测试头插=====");
        mySingleList.addFirst(0);
        mySingleList.display4(mySingleList.head);
        System.out.println();
        System.out.println("=====测试尾插=====");
        mySingleList.addLast(8);
        mySingleList.display4(mySingleList.head);
        System.out.println();
        System.out.println("=====测试任意位置插入=====");
        mySingleList.addIndex(88,3);
        mySingleList.addIndex(88,5);
        mySingleList.addIndex(88,7);
        mySingleList.display4(mySingleList.head);
        System.out.println();
        System.out.println("=====测试删除所有key=====");
        mySingleList.removeKey(88);
        mySingleList.display4(mySingleList.head);
        System.out.println();
        System.out.println("====测试置空链表=======");
        mySingleList.clear();
        mySingleList.display4(mySingleList.head);*/
        System.out.println();
        System.out.println("====测式反转链表=======");
        mySingleList.reverseList(mySingleList.head);
        mySingleList.display4(mySingleList.head);
        boolean ret = mySingleList.hasCycle(mySingleList.head);
        System.out.println(ret);
    }
}
